package com.taiji.dianthus.sms;

/**
 * @author h.m
 * @Desc 获取上行报告返回代码描述枚举
 */
public enum SMSReportCodeEnum {

    //成功
    SUCCESS("CM:0000", "发送成功"),
    SIGN_NOT_EXISTENT("CM:1004", "签名编号不存在"),
    MODEL_NOT_EXISTENT("CM:1005", "短信模版编号不存在"),
    MODEL_LENGTH_IS_NOT_ASK("CM:1006", "短信模版变量参数个数和实际要求不一致"),
    TRIGGER_GLOBAL_KEYWORD("CM:8001", "触发全局关键字"),
    TRIGGER_GLOBAL_BLACKLIST("CM:8003", "触发全局黑名单"),
    TRIGGER_EC_BLACKLIST("CM:8004", "触发EC黑名单"),
    TRUE_GATEWAY_RECEIVED_MSG("CM:3000", "真实网关接收消息"),
    SIRG_IS_NULL("CM:3007", "业务代码错误，缺少签名编码"),
    USER_IS_INVALID("CM:4001", "无效的接入用户"),
    MSG_CONETENT_IS_TOO_LONG("CM:4002", "不允许提交长短信"),
    ILLEGAT_LONG_MSG_FORMAT("CM:4003", "非法的长短信格式"),
    ILLEGAT_MSG_FORMAT("CM:CM:4004", "非法的消息格式"),
    NOT_FOUND_ROUTE("CM:4005", "未找到路由"),
    NOT_FOUND_SIGN("CM:4006", "未找到相应的异网签名编码"),
    NOT_INVALID_USERNAME_OR_PWD("CM:4007", "无效的用户名或密码"),
    MOBILES_IS_TOO_LONG("CM:4008", "报文中携带的手机号超出限制"),
    CONFLICT_SIGN_AND_INFO("CM:4009", "签名编码与用户信息冲突"),
    CONTENT_CONTAINS_SENSITIVE_WORDS("CM:8002", "发送的短信内容包含研究院敏感词"),
    MCAGENTTCPSENDER_IS_NOT_OPEN("CM:8006", "McAgentTcpSender未启动"),
    REQUEST_TIMEOUT("CM:9999", "请求超时");


    private String code;
    private String msg;

    SMSReportCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 根据代码获取代码描述信息
     *
     * @param code
     * @return
     */
    public static String getResultMsg(String code) {
        SMSReportCodeEnum[] codeEnums = values();
        for (SMSReportCodeEnum resultCodeEnum : codeEnums) {
            if (resultCodeEnum.getCode().equals(code)) {
                return resultCodeEnum.getMsg();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
